Skip to content

Conversation

@sfc-gh-fpawlowski
Copy link
Contributor

Approach 1 - idempotent aenter through checking if conn closed.
Main benefit - calling SnowflakeConnection.aenter in the snowflake.connector.aio.connect.aenter - we can feel safe from missing some logic there.

Main drawback - will always conn.is_closed() be reliable.

Analogous to: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client.py#L1376-L1412

@sfc-gh-fpawlowski sfc-gh-fpawlowski self-assigned this Oct 28, 2025
Comment on lines +32 to +42
def send(self, arg: Any) -> Any:
"""Send a value into the wrapped coroutine."""
return self._coro.send(arg)

def throw(self, *args: Any, **kwargs: Any) -> Any:
"""Throw an exception into the wrapped coroutine."""
return self._coro.throw(*args, **kwargs)

def close(self) -> None:
"""Close the wrapped coroutine."""
return self._coro.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those methods used somewhere?

Base automatically changed from cherrypicks-to-aio-connector-part23a to dev/aio-connector October 29, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants